/*
 * exceptions.C
 *
 *  (c) by Normen Seemann
 *
 *  Created on: Apr 28, 2009
 *
 */

#include <stdio.h>
#include <core/exceptions.h>

namespace crossEyed
{
namespace core
{

   void TException::print(FILE *f)
   {
      fprintf(f, "Exception caught in %s() at line %u.\n", pFuncName, line);
   }

   void TAssertion::print(FILE *f)
   {
      fprintf(f, "Assertion tripped ( %s ) in %s() at line %u.\n", pExpression , pFuncName, line);
   }

   void TOOMemoryException::print(FILE *f)
   {
      fprintf(f, "Out of memory in %s() at line %u.\n", pFuncName, line);
   }

   void TIOException::print(FILE *f)
   {
      fprintf(f, "Could not perform file operation on %s(errno = %i) in %s() at line %u.\n", fileName.data(), errNo, pFuncName, line);
   }

   void TError::print(FILE *f)
   {
      fprintf(f, "User error: %s in %s() at line %u.\n", pErrorMessage, pFuncName, line);
   }
}}
